import 'package:ad_x_sdk/ad_x_sdk.dart';
import 'package:flutter/material.dart';
import '../constant/KeyConstant.dart';
import '../scene/ExampleScene.dart';

void main() {
  runApp(new MyApp());
}

/*
 * 启动入口 <br/>
 * @link https://gitee.com/qlslylq/UnityDesign
 * @link https://gitee.com/qlslylq/FlutterDesign
 * @link https://gitee.com/qlslylq/AndroidDesign
 * @link https://gitee.com/qlslylq/JavaDesign
 */
class MyApp extends StatelessWidget {
  StatelessElement createElement() {
    asyncInit();
    return super.createElement();
  }

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: ExampleScene(),
    );
  }

  Future<void> asyncInit() async {
    try {
      var param = {
        "appId": KeyConstant.JH_APP_ID,
        "isTest": false,
        "isDebug": true
      };
      await AdXSdk.initSDK(param);
    } on Exception catch (e) {}
  }
}
